#!/bin/bash
#################################################################
#                                                         	#                  
#  Released under the GNU Public License                  	#                  
#                                                         	#    	              
#  Script   :  echo_enable                                	#
#  Author   :  Marcus Xenakis WA2DCI                      	#
#  Version  :  .13 Beta                                   	#
#  Date     :  3/15/03                                    	#
#  About    :  This script enables EchoLink               	#
#              IRLP must be enbled for EchoIRLP                 #
#  Modified :  3/15/03 to use forcekey/forceunkey               #
#              1/03/04 VK2XJG added check for repeater user     #
#################################################################

[ -z "$ECHO_SCRIPT" ] && ECHO_SCRIPT=/home/EchoIRLP/scripts
   source $ECHO_SCRIPT/echo_common

# Exits if node is not enabled
if [ -f "$LOCAL"/echo_enable ] ; then 
  log "The node is already enabled"
  exit 0
fi

touch "$LOCAL"/echo_enable

"$BIN"/forcekey
usleep ${TXDELAY:-250000}
play "$ECHO_AUDIO"/echoenabled.wav
usleep 250000
"$BIN"/forceunkey

"$ECHO_SCRIPT"/echo_status update
log "Enabled EchoIRLP."
exit 0


